package com.wjf.birdfish.commons;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;


/**
 * Created on 2010-07-21
 * <p>
 * Title: 记录用户操作日志的过滤器
 * </p>
 * 
 * @author wangjunfeng</a>
 * @version 1.0
 */

public class LogFilter implements Filter {
	private Logger logger = LoggerFactory.getLogger(this.getClass());

	public FilterConfig config = null;
	private ApplicationContext ac;

	public void destroy() {
		config = null;
	}

	public void doFilter(ServletRequest request, ServletResponse response,
			FilterChain chain) throws IOException, ServletException {

		chain.doFilter(request, response);
	}

	public void init(FilterConfig arg0) throws ServletException {
		ac = new ClassPathXmlApplicationContext("classpath:spring/*.xml");
		this.config = arg0;

	}

	private boolean initContext(ServletRequest request) {
		HttpSession session = ((HttpServletRequest) request).getSession();
		return true;
	}


}